/**
 * Definition for a binary tree node.
 * function TreeNode(val, left, right) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.left = (left===undefined ? null : left)
 *     this.right = (right===undefined ? null : right)
 * }
 */
/**
 * @param {TreeNode} root
 * @return {number}
 */
 var sumOfLeftLeaves = function(root) {
    let res=0;
    function digui(root,isleft){
        if(!root){
            return ;
        }
        if(!root.left && !root.right && isleft){
            res += root.val;
            return ;
        }
        digui(root.left,true);
        digui(root.right,false);
    }
    digui(root,false);
    return res;
};